package com.xiaotu.dao.sw;

import com.xiaotu.model.SwLeaveMsgModel;
import com.xiaotu.vo.SwLeaveMsgVo;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;


/**
 * @author zhangxiao
 * @create 2021-09-06 10:43
 */
public interface SwLeaveMsgMapper extends Mapper<SwLeaveMsgModel> {

    @Select("<script>" +
            " SELECT  " +
            "  t1.sw_leave_msg_id,  " +
            "  t1.be_leave_msg_star_id,  " +
            "  t1.leave_msg_user_id,  " +
            "  t1.company,  " +
            "  t1.post,  " +
            "  t1.contacts,  " +
            "  t1.contacts_phone,  " +
            "  t1.leave_msg,  " +
            "  t1.create_time,  " +
            "  t2.nick_name,  " +
            "  t2.avatar_url    " +
            "FROM  " +
            "  tab_sw_leave_msg t1  " +
            "  LEFT JOIN tab_wx_user t2 ON t1.leave_msg_user_id = t2.userid  " +
            "  WHERE t1.be_leave_msg_star_id = #{beLeaveMsgUserId}  " +
            "  ORDER BY t1.create_time DESC " +
            "</script>")
    List<SwLeaveMsgVo> getSwLeaveMsg(Integer beLeaveMsgUserId);
}
